package com.bardpub.controls.flvplayer
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	public class KControlBar extends Sprite implements IKControlBar
	{
		public function KControlBar()
		{
			btnPlay.addEventListener(MouseEvent.CLICK, onBtnPlay);
			btnFull.addEventListener(MouseEvent.CLICK, onBtnFull);
		}
		
		private function onBtnFull(e:MouseEvent):void 
		{
			dispatchEvent(new Event(KPlayer.FULLSCREEN));
		}
		
		private function onBtnPlay(e:MouseEvent):void 
		{
			dispatchEvent(new Event(KPlayer.START));
		}
		
		public function set loadProgress(value:Number):void 
		{
			line.width = 200 * value;
		}
		
		public function set playedTime(value:Number):void 
		{
			dragbtn.x = 16 + value * 200;
		}
		
		public function clear():void 
		{
			
		}
		
		public function autoSize(w:Number, h:Number):void 
		{
			this.y = h - this.height;
		}
	}
	
}